#fastapi
from fastapi import FastAPI
import os
# import fastapi_cdn_host
import sys
from fastapi.staticfiles import StaticFiles
from .views import index,login,register,home,deviceDetail,topology,ssetopology,PveProject
def create_app():
    BASE_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
    path = os.path.join(BASE_DIR, 'app/static')
    app = FastAPI(docs_url=None, redoc_url=None)
    # fastapi_cdn_host.patch_docs(app)
    app.mount("/static", StaticFiles(directory=path), name="static")
    app.include_router(index.index_router)
    app.include_router(login.login_router)
    app.include_router(register.register_router)
    app.include_router(home.home_router)
    app.include_router(deviceDetail.deviceDetail_router)
    app.include_router(topology.topology_router)
    app.include_router(ssetopology.ssetopology_router)
    app.include_router(PveProject.PveProject_router)
    return app